// $ANTLR 3.1.2 /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g 2009-07-21 18:11:31

	package com.inexas.cu.stratus;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

/**
 *	Bigtable Constraints Parser
 */
@SuppressWarnings("all")
public class StratusParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "LT", "LTE", "EQUAL1", "EQUAL2", "GTE", "GT", "ASC", "DESC", "TRUE", "FALSE", "Identifier", "String", "Number", "JavaLetter", "Digit", "EscapeSequence", "UnicodeEscape", "OctalEscape", "HexDigit", "WS"
    };
    public static final int Digit=18;
    public static final int Identifier=14;
    public static final int HexDigit=22;
    public static final int WS=23;
    public static final int FALSE=13;
    public static final int LT=4;
    public static final int GT=9;
    public static final int ASC=10;
    public static final int EQUAL2=7;
    public static final int String=15;
    public static final int LTE=5;
    public static final int UnicodeEscape=20;
    public static final int GTE=8;
    public static final int EscapeSequence=19;
    public static final int EOF=-1;
    public static final int EQUAL1=6;
    public static final int JavaLetter=17;
    public static final int DESC=11;
    public static final int OctalEscape=21;
    public static final int Number=16;
    public static final int TRUE=12;

    // delegates
    // delegators


        public StratusParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public StratusParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return StratusParser.tokenNames; }
    public String getGrammarFileName() { return "/Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g"; }


    	public String identifier, operator, literal;
    	public char direction;



    // $ANTLR start "parse"
    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:32:1: parse : constraint EOF ;
    public final void parse() throws RecognitionException {
        try {
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:33:2: ( constraint EOF )
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:33:4: constraint EOF
            {
            pushFollow(FOLLOW_constraint_in_parse119);
            constraint();

            state._fsp--;

            match(input,EOF,FOLLOW_EOF_in_parse121); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "parse"


    // $ANTLR start "constraint"
    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:36:1: constraint : (i= Identifier ( direction )? | i= Identifier operator literal );
    public final void constraint() throws RecognitionException {
        Token i=null;

        try {
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:37:2: (i= Identifier ( direction )? | i= Identifier operator literal )
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==Identifier) ) {
                int LA2_1 = input.LA(2);

                if ( (LA2_1==EOF||(LA2_1>=ASC && LA2_1<=DESC)) ) {
                    alt2=1;
                }
                else if ( ((LA2_1>=LT && LA2_1<=GT)) ) {
                    alt2=2;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 2, 1, input);

                    throw nvae;
                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;
            }
            switch (alt2) {
                case 1 :
                    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:37:4: i= Identifier ( direction )?
                    {
                    i=(Token)match(input,Identifier,FOLLOW_Identifier_in_constraint134); 
                    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:37:17: ( direction )?
                    int alt1=2;
                    int LA1_0 = input.LA(1);

                    if ( ((LA1_0>=ASC && LA1_0<=DESC)) ) {
                        alt1=1;
                    }
                    switch (alt1) {
                        case 1 :
                            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:37:17: direction
                            {
                            pushFollow(FOLLOW_direction_in_constraint136);
                            direction();

                            state._fsp--;


                            }
                            break;

                    }


                    			identifier = i.getText();
                    		

                    }
                    break;
                case 2 :
                    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:40:4: i= Identifier operator literal
                    {
                    i=(Token)match(input,Identifier,FOLLOW_Identifier_in_constraint146); 
                    pushFollow(FOLLOW_operator_in_constraint148);
                    operator();

                    state._fsp--;

                    pushFollow(FOLLOW_literal_in_constraint150);
                    literal();

                    state._fsp--;


                    			identifier = i.getText();
                    		

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "constraint"


    // $ANTLR start "direction"
    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:45:1: direction : d= ( ASC | DESC ) ;
    public final void direction() throws RecognitionException {
        Token d=null;

        try {
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:46:2: (d= ( ASC | DESC ) )
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:46:4: d= ( ASC | DESC )
            {
            d=(Token)input.LT(1);
            if ( (input.LA(1)>=ASC && input.LA(1)<=DESC) ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            			direction = d.getText().charAt(0);
            		

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "direction"


    // $ANTLR start "operator"
    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:51:1: operator : c= ( LT | LTE | EQUAL1 | EQUAL2 | GTE | GT ) ;
    public final void operator() throws RecognitionException {
        Token c=null;

        try {
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:52:2: (c= ( LT | LTE | EQUAL1 | EQUAL2 | GTE | GT ) )
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:52:4: c= ( LT | LTE | EQUAL1 | EQUAL2 | GTE | GT )
            {
            c=(Token)input.LT(1);
            if ( (input.LA(1)>=LT && input.LA(1)<=GT) ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            			operator = c.getText();
            		

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "operator"


    // $ANTLR start "literal"
    // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:57:1: literal : l= ( String | Number | TRUE | FALSE ) ;
    public final void literal() throws RecognitionException {
        Token l=null;

        try {
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:58:2: (l= ( String | Number | TRUE | FALSE ) )
            // /Users/keith/Documents/workspace/com.inexas.cu/srcCu/com/inexas/cu/stratus/Stratus.g:58:4: l= ( String | Number | TRUE | FALSE )
            {
            l=(Token)input.LT(1);
            if ( (input.LA(1)>=TRUE && input.LA(1)<=FALSE)||(input.LA(1)>=String && input.LA(1)<=Number) ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            			literal = l.getText();
            		

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "literal"

    // Delegated rules


 

    public static final BitSet FOLLOW_constraint_in_parse119 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_parse121 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_constraint134 = new BitSet(new long[]{0x0000000000000C02L});
    public static final BitSet FOLLOW_direction_in_constraint136 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_constraint146 = new BitSet(new long[]{0x00000000000003F0L});
    public static final BitSet FOLLOW_operator_in_constraint148 = new BitSet(new long[]{0x000000000001B000L});
    public static final BitSet FOLLOW_literal_in_constraint150 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_direction166 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_operator189 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_literal217 = new BitSet(new long[]{0x0000000000000002L});

}